﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace State
{
    internal class NightState : IState
    {
        private static NightState singleton = new();
        private NightState() { }
        public static NightState Instance { get { return singleton; } }

        public void DoAlarm(IContext context)
        {
            context.RecordLog("按下警铃（晚上）");
        }

        public void DoClock(IContext context, int hour)
        {
            if (hour >= 9 || hour < 17)
            {
                context.ChangeState(NightState.Instance);
            }
        }

        public void DoPhone(IContext context)
        {
            context.RecordLog("晚上的通话录音");
        }

        public void DoUse(IContext context)
        {
            context.RecordLog("紧急：晚上使用金库");
        }

        public override string ToString()
        {
            return "[ 晚上 ]";
        }
    }
}
